<?php
declare (strict_types=1);

namespace app\admin\validates;

use think\Validate;

/**
 * DeviceApk验证器
 */
class DeviceApkValidate extends Validate
{
    /**
     * 验证规则
     * @var array
     */
    protected $rule = [
        'id' => 'require|number',
        'name' => 'require|max:50',
        'version' => 'require|max:50',
        'type' => 'require|number',
        'src' => 'require|max:255',
        'size' => 'require|number',
        'remark' => 'max:255',
    ];

    /**
     * 验证字段描述
     * @var string[]
     */
    protected $field = [
        'id' => 'ID',
        'name' => '名称',
        'version' => '版本号',
        'type' => '设备类型',
        'src' => '文件地址',
        'size' => '文件大小',
        'remark' => '备注',
    ];

    /**
     * 验证场景
     * @var array
     */
    protected $scene = [
        'add' => ['name', 'version', 'type', 'src', 'size', 'remark'],
    ];

}